package com.xbongbong.saas.model.impl;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.saas.domain.dao.ProductUnitRateDao;
import com.xbongbong.saas.domain.entity.ProductUnitRateEntity;
import com.xbongbong.saas.model.ProductUnitRateModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service("productUnitRateModel")
public class ProductUnitRateModelImpl implements ProductUnitRateModel {

    @Resource
    private ProductUnitRateDao productUnitRateDao;

    @Override
    public Integer insert(ProductUnitRateEntity entity) throws XbbException {
        return productUnitRateDao.insert(entity);
    }

    @Override
    public Integer update(ProductUnitRateEntity entity) throws XbbException {
        return productUnitRateDao.update(entity);
    }

    @Override
    public List<ProductUnitRateEntity> findEntitys(Map<String, Object> param) {
        return productUnitRateDao.findEntities(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return productUnitRateDao.getEntitiesCount(param);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }

    @Override
    public void insertBatch(List<ProductUnitRateEntity> productUnitRateList) {
        productUnitRateDao.insertBatch(productUnitRateList);
    }

    @Override
    public void deleteByGroupId(Long groupId, String corpid) {
        productUnitRateDao.deleteByGroupId(groupId, corpid);
    }

    @Override
    public void deleteBatch(List<ProductUnitRateEntity> delList, String corpid) {
        productUnitRateDao.deleteBatch(delList, corpid);
    }

    @Override
    public void updateBatch(List<ProductUnitRateEntity> updateList, String corpid) {
        productUnitRateDao.updateBatch(updateList, corpid);
    }
}
